using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Thaire.Investment.Domains.Transaction
{
   
    public class RatingHistory 
    {
        #region Properties
        // RATING_HISTORY_ID
        public virtual int RatingHistoryId { set; get; }
        // FINANCIAL_INSTRUMENT_ID
        public virtual int? FinancialInstrumentId { set; get; }
        // FINANCIAL_INSTRUMENT_TYPE
        public virtual String FinancialInstrumentType { set; get; }
        //FINANCIAL_INSTRUMENT_TYPE_ID
        public virtual int FinancialInstrumentTypeID { get; set; }
        // ISSUE_RATING
        public virtual String IssueRating { set; get; }
        // ISSUE_CREDIT_AGENCY
        public virtual String IssueCreditAgency { set; get; }
        // ISSUE_UPDATE_DATE
        public virtual DateTime? IssueUpdateDate { set; get; }
        // ISSUE_CREDIT_AGENCY_COUNTRY
        public virtual String IssueCreditAgencyCountry { set; get; }
        // ISSUER_RATING
        public virtual String IssuerRating { set; get; }
        // ISSUER_CREDIT_AGENCY
        public virtual String IssuerCreditAgency { set; get; }
        // ISSUER_UPDATE_DATE
        public virtual DateTime? IssuerUpdateDate { set; get; }
        // ISSUER_CREDIT_AGENCY_COUNTRY
        public virtual String IssuerCreditAgencyCountry { set; get; }
        // GUARANTOR_RATING
        public virtual String GuarantorRating { set; get; }
        // GUARANTOR_CREDIT_AGENCY
        public virtual String GuarantorCreditAgency { set; get; }
        // GUARANTOR_UPDATE_DATE
        public virtual DateTime? GuarantorUpdateDate { set; get; }
        // GUARANTOR_CREDIT_AGENCY_COUNTRY
        public virtual String GuarantorCreditAgencyCountry { set; get; }
        // CREATE_USER_ID
        public virtual String CreateUserId { set; get; }
        // CREATE_TS
        public virtual DateTime? CreateTs { set; get; }

        #endregion

        

        public override bool Equals(object obj)
        {
            if(obj == null)
                return false;
            if(obj.GetType() != typeof(RatingHistory) && !(obj is RatingHistory))
                return false;
            return ToString().Equals(obj.ToString());
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }

        public override string ToString()
        {
            return string.Format("{0}", RatingHistoryId);
        }

        public virtual string DataKey()
        {
            return string.Format("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}",
                IssueRating, 
                IssueCreditAgency,
                IssueUpdateDate.GetValueOrDefault(),
                IssueCreditAgencyCountry,
                IssuerRating,
                IssuerCreditAgency,
                IssuerUpdateDate.GetValueOrDefault(), 
                IssuerCreditAgencyCountry, 
                GuarantorRating,
                GuarantorCreditAgency, 
                GuarantorUpdateDate,
                GuarantorCreditAgencyCountry);
        }



    }

   

}